# Fibonnaci property:
# f(x) = f(x-1) + f(x-2)
# f0 = 1
# f1 = 2 (even)
# f2 = 3
# f3 = 5
# f4 = 8 (even)
# f(x) is even for x = 1 mod 3
#
# Rewrite f(x) in fonction of f(y) with y = x - 3*k
# f(x) = 1*f(x - 1) + 1*f(x - 2)
# f(x) = 2*f(x - 2) + 1*f(x - 3)
# f(x) = 3*f(x - 3) + 2*f(x - 4)
# f(x) = 5*f(x - 4) + 3*f(x - 5)
# f(x) = 8*f(x - 5) + 5*f(x - 6)
# f(x) = 4*f(x - 4) + 4*f(x - 5) + f(x - 6)
# f(x) = 4*f(x - 3) + f(x - 6)
#
# fibonacci even term only:
# g(x) = 4*g(x-1) + g(x-2)
# g(0) = 2
# g(1) = 8
# g(2) = 34


def Solve():
    res = 0
    g0, g1 = 2, 8
    while g0 <= 4000000:
        res += g0
        g0, g1 = g1, 4*g1 + g0
    return res

